package com.gaga.common.enums;

public enum ScriptType {
    KEYWORD("keyword", "关键字"),
    SMART_REPLY("smartReply", "智能回复"),
    USER_ENTER("userEnter", "用户新进"),
    MAIN_AUDIO("mainAudio", "主音频"),
    RANDOM_AUDIO("randomAudio", "随机音频"),
    INSERT_AUDIO("insertAudio", "插播音频"),
    MAIN_VIDEO("mainVideo", "主视频");

    private final String code;
    private final String info;

    ScriptType(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static ScriptType getScriptTypeByInfo(String info) {
        for (ScriptType scriptType : ScriptType.values()) {
            if (info.contains(scriptType.getInfo())) {
                return scriptType;
            }
        }
        return null;
    }
}
